
###########################################################################
################They Only Hate the Term Replication Data###################
###########################################################################

#Recall datasets
TOHTT2020<-read.csv("~TOHTT2020data.csv")
TOHTT2021<-read.csv("~TOHTT2021data.csv")
TOHTT2022<-read.csv("~TOHTT2022data.csv")

##Results for Table 2#####

controldata2020<-subset(TOHTT2020,curriculum_racism_no_consent_treatment==0,select=c(curriculum_racism, curriculum_racism_mean, support_protests, satisfaction_overall_district, parent_school_age, black, white, latinx, asian, other, female, democrat, republican, independent, liberal, conservative, age, age65, high.income, mid.income))

mean(controldata2020$curriculum_racism_mean)

controldata2020 %>%
  group_by(parent_school_age) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
   group_by(black) %>%
   summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(white) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(democrat) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(republican) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(liberal) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(conservative) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))

controldata2020 %>%
  group_by(age65) %>%
  summarise_at(vars(curriculum_racism_mean), list(name = mean))


controldata2021<-subset(TOHTT2021,racism_curriculum_treatment==0,select=c(racism_curriculum, racism_curriculum_mean, oppose_protests, satisfaction_overall_schools, parent_school_age, white, black, female, democrat, republican, independent, liberal, conservative, age, age65, high.income, mid.income))

mean(controldata2021$racism_curriculum_mean)

controldata2021 %>%
  group_by(parent_school_age) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
controldata2021 %>%
             group_by(black) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
controldata2021 %>%
             group_by(white) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
           controldata2021 %>%
             group_by(democrat) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
           controldata2021 %>%
             group_by(republican) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
           controldata2021 %>%
             group_by(liberal) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
           controldata2021 %>%
             group_by(conservative) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
           
           controldata2021 %>%
             group_by(age65) %>%
             summarise_at(vars(racism_curriculum), list(name = mean))
           
###Results for Table 3#####
           
           
####2020 regression model
curriculum_racism_model20<-lm(curriculum_racism ~ curriculum_racism_no_consent_treatment + oppose_protests + satisfaction_overall_district  + parent_school_age + white + female + democrat + independent + liberal + age + high.income + mid.income, data=TOHTT2020)
           
summary(curriculum_racism_model20)
           
           
#####2021 regression model
           
racism_teaching_model21<-lm(racism_curriculum ~ racism_curriculum_treatment + oppose_protests + support_capitol_raid + satisfaction_overall_schools + parent_school_age + white + female + democrat + independent + liberal + high.income + mid.income + age, data=TOHTT2021)
           
summary(racism_teaching_model21)
           
       
                    
###Results for Table 4#####


####2020 regression model

summary(curriculum_racism_model20)


#####2021 regression model


summary(racism_teaching_model21)

#####recall 2022 data###


racism_teaching_model22<-lm(racism_curriculum ~ racism_curriculum_treatment + oppose_protests + support_insurrection + election_unfair + school_board_voter + school_satisfaction + parent + white + female + democrat + independent + liberal + high_income + mid_income + age, data=TOHTT2022)

summary(racism_teaching_model22)


